<?php

namespace common\models\models;

use common\models\Category;

class CategoryModel
{
    /**
     * cid 转 caname
     * @param $cid
     * @return mixed|string
     */
    public static function cid2cname($cid)
    {
        $cate = Category::find()->where(['id' => $cid])->asArray()->one();
        return !empty($cate['cname']) ? $cate['cname'] : '未知分类';
    }


}